package misc;

import gui.MainWindow;

public class NotificationThread extends Thread {

	public static final long DELAY = 1500;
	
	private String text;
	private MainWindow parent;
	
	public NotificationThread(MainWindow p, String t) {
		super();
		
		this.text = t;
		this.parent = p;
	}
	
	public void run() {		
		try {
			Thread.sleep(NotificationThread.DELAY);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		
		if (this.parent.getLastNotification() == this)
			this.parent.changeWindowStatutBar(this.text);		
	}
	
	public void changeText(String t) {
		this.text = t;
	}
}
